(function(angular) {
	'use strict';
	angular.module("fs.waf").factory("custAcctTypeService", custAcctTypeService);
	custAcctTypeService.$inject = [ '$q', 'loggerFactory', 'ajaxServiceFactory'];
	function custAcctTypeService($q, loggerFactory, ajaxServiceFactory) {
		var log = loggerFactory.getLogger("custAcctTypeService");
		var ajaxService = ajaxServiceFactory.buildAjaxService({
			getDataStatus : {
				url : 'do/cda/dataList/dataStatus',
				method : 'get'
			}
		});
		
		function initOptions(){
			var defer = $q.defer();
			var dataStatusOptions = {};
			dataStatusOptions.data = [];
			ajaxService.getDataStatus().then(function(response) {
				if(response.data){
					angular.forEach(response.data.data, function(data, index, array){
						dataStatusOptions.data.push({"value" : data.value, "label" : data.label});
					});
				}
				defer.resolve(dataStatusOptions);
			}, angular.noop);
			return defer.promise;
		};
		
		return {
			initOptions : initOptions
		};
	}
})(angular);